﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Ext.Net;
using System.Data;
using System.Web.Script.Serialization;

public partial class UserList : ExtBaseRpt
{
    string mid;
    sendweixin weixin = new sendweixin();
    protected void Page_Load(object sender, EventArgs e)
    {
        mid = Request.Params["mid"];
        if (!X.IsAjaxRequest)
        {
            txtbdate.Text = DateTime.Now.ToString();
            txtedate.Text = DateTime.Now.ToString();
            //BuildGridPanel(this.GridPanel1, mid, Session["UserID"].ToString());
        }
    }
    protected void BtnQureyUser(object sender, DirectEventArgs e)
    {
        string str = " and cast(convert(varchar(20),createdate,23)as datetime) between '" + txtbdate.Text + "' and '" + txtedate.Text + "'";
        if (txtparam.Text != "")
        {
            str += " and username like '%"+txtparam.Text+"%' or mobile like '%"+txtparam.Text+"%'";
        }
        string sql = @"select convert(varchar(20),createdate,120)as Cdate,convert(varchar(20),birthday,23)as Bdate,
                        case when isnull(sex,'') = '0' then '男' else '女' end as sexname,* 
                        from job_user where 1=1 " + str + " order by createdate desc";
        QueryData(this.Store1, mid, sql);
    }

    protected void RefreshDataSet(object sender, StoreReadDataEventArgs e)
    {
        BtnQureyUser(null,null);
    }
    protected void Store1_Submit(object sender, StoreSubmitDataEventArgs e)
    {
        //导出EXCEL
        ExtGridToExcel(mid,"xls",e.Xml,this.Response,this.Title);
    }
}
